<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="s" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>库存统计报表</title>
    <jsp:include page="easyuiIncludeJS.jsp"/>

    <script type="text/javascript">
        $(function () {
            var pager = $(".easyui-datagrid").datagrid('getPager');
            $(pager).pagination({
                total:${pager.totalRows},
                pageSize:${pager.pageRow},
                displayMsg: '{from}-{to}/{total}',
                pageNumber:${pager.cur_page},
                afterPageText: '页，共{pages}页',
                pageList: [5, 10, 20, 30, 50, 100],
                loading: false,
                showPageList: true,
                showRefresh: true,
                //刷新方法
                onBeforeRefresh: function (p, s) {
                    location.href = "${pageContext.request.contextPath }/admin/report/listStat?cur_page=" + p + "&pageRow=" + s;
                },
                onSelectPage: function (p, s) {
                    location.href = "${pageContext.request.contextPath }/admin/report/listStat?cur_page=" + p + "&pageRow=" + s;
                }
            });
            $('#changesize').datagrid('resize', {
                height:document.body.clientHeight-100
            });
        });
      </script>
      <script type="text/javascript">
        function ss(val) {
        	$("#oprFlag").val(val);
            document.forms[0].submit();
        }

    </script>
</head>
<body>
<div id="tb">
	<table width="100%" border="0">
		<tr>
			<td>
			    <a class="easyui-linkbutton" plain="true" icon="icon-undo" href="javascript:void(0);" onclick="ss(1);">导出</a>
			</td>
			<td align="right">
			    <form id="form1" action="${pageContext.request.contextPath}/admin/report/listStat" method="post">
				    <input type="hidden" name="oprFlag" id="oprFlag" value="0">
				    仓库: <select id="supplierId" name="supplierId">
						<option value="0">不选择</option>
						<c:forEach items="${storageList }" var="d">
						<c:if test="${ord.supplierId==d.storageId}">
							<option value="${d.storageId}" selected="selected">${d.storageName}(${d.storageCode})</option>
						</c:if>
						<c:if test="${ord.supplierId!=d.storageId}">
							<option value="${d.storageId}">${d.storageName}(${d.storageCode})</option>
						</c:if>
						</c:forEach>
					 </select>
					物料名称:<input type="text" name="remark" id="remark" value="${ord.remark}" style="width: 100px">
					日期:<input class="easyui-datebox" id="orderDate" name="orderDate" value="${ord.orderDate}" editable="false"  style="width:130px;">
				   -<input class="easyui-datebox" id="orderDate2" name="orderDate2" value="${ord.orderDate2}" editable="false" style="width:130px;">
			        <a href="javascript:void(0);" class="easyui-linkbutton" plain="true" onclick="ss(0);" iconCls="icon-search" >搜索</a>
			    </form>
			</td>
		</tr>
	</table>
</div>
<table class="easyui-datagrid" id="changesize" pagination="true" style="height:620px;width: auto;" singleSelect="true">
    <thead>
    <tr>
		<th width="120" align="center" field="storageName">仓库</th>
        <th width="80" align="center" field="materialCode" >物料编码</th>
        <th width="120" align="center" field="materialName">物料名称</th>
		<th width="130" align="center" field="style">规格</th>
		<th width="130" align="center" field="batchNo">批号</th>
		<th width="120" align="center" field="orderId">订单号</th>
		<th width="120" align="center" field="materialUnit">单位</th>
		<th width="100" align="center" field="orderCnt">入库数量</th>
	</tr>
    </thead>
    <tbody>
    <c:forEach items="${pager.datas}" var="d">
		<tr>
			<td>${d.storageName}</td>
			<td>${d.materialCode}</td>
			<td>${d.materialName}</td>
			<td>${d.style}</td>
			<td>${d.batchNo}</td>
			<td>${d.orderId}</td>
			<td>${d.materialUnit}</td>
			<td>${d.orderCnt}</td>
		</tr>
    </c:forEach>
    </tbody>
</table>
</body>
</html>